package com.weilan.ark3.utils;

import com.weilan.ark3.buffer.DataArray2;
import com.weilan.ark3.entity.ConfigDto;
import com.weilan.ark3.sqlite.SQLiteConfigUtils;

public class ammeterUtils {

    public static short Grid_power;
    public static short getGrid_Power(){
        ConfigDto configDto = SQLiteConfigUtils.query();
        String ammeterType = configDto.getAmmeterType();
        //电表功率数据
        if (ammeterType.equals("东鸿")) {
            //东鸿电网电表功率
            Grid_power = HexUtils.Power(DataArray2.data[12], DataArray2.data[13], DataArray2.data[14], DataArray2.data[15], DataArray2.data[16], DataArray2.data[17]);
        } else if (ammeterType.equals("安科瑞")) {
            //安科瑞电网电表功率
            Grid_power = HexUtils.AnPower(DataArray2.data[362], DataArray2.data[363], DataArray2.data[141], DataArray2.data[142]);
        }
        return Grid_power;
    }
}
